//
// Created by chaseaishang on 23-4-16.
//

#include "Input.h"

//待做，应该用用一个windows类来承接获取getKey
#include "test.h"

bool Input::IsKeyPressedImpl(int keycode)
{
    auto window=test::TestMenu::Get().getNativeWindow();
    auto state = glfwGetKey(window, keycode);
    return state == GLFW_PRESS || state == GLFW_REPEAT;

}

std::pair<float, float> Input::GetMousePositionImpl()
{
    auto window=test::TestMenu::Get().getNativeWindow();
    double xpos, ypos;
    glfwGetCursorPos(window, &xpos, &ypos);
    return std::pair<float, float>(xpos,ypos);
}

bool Input::IsMouseButtonPressedImpl(int MouseCode) {
    return false;
}
